<style lang="less">
@import '../../../styles/table-common.less';
@import '../../personInfo.less';
</style>
<template>
    <div class="search">
        <Row :gutter="16" class="all-height">
            <Col span="5" class="all-height">
                <Card class="all-height" style="overflow-y: scroll">
                    <Alert show-icon>
                        当前选择：
                        <span class="select-title">{{ editTitle }}</span>
                        <a class="select-clear" @click="cancelEdit">取消选择</a>
                    </Alert>
                    <Input v-if='resource === "1"' v-model="searchKey" suffix="ios-search" @on-change="search" placeholder="输入院校或院系名称搜索" clearable />
                    <div style="position: relative">
                        <div class="tree-bar" :style="{ maxHeight: maxHeight }">
                            <Tree ref="tree" :data="dataTree" :render="renderContent" @on-select-change="selectTree" @on-check-change="changeSelect" :check-strictly="!strict"></Tree>
                        </div>
                        <Spin size="large" fix v-if="loading1"></Spin>
                    </div>
                </Card>
            </Col>
            <Col :span="showRight ? 13 : 19" class="all-height">
                <Card class="all-height card-child-height">
                    <Row class="operation code-row-bg" style="display: flex; justify-content: space-between">
                        <Col span="22">
                            <Dropdown @on-click="handleDropdown">
                                <Button>
                                    更多操作
                                    <Icon type="md-arrow-dropdown" />
                                </Button>
                                <DropdownMenu slot="list">
                                    <DropdownItem name="refresh">刷新</DropdownItem>
                                </DropdownMenu>
                            </Dropdown>
                            <Button @click="dropExportAll">导出全部数据</Button>
                          <Button @click="showWindows">同步专业分类</Button>
                            <Button type="dashed" @click="openTip = !openTip">{{ openTip ? '关闭提示' : '开启提示' }}</Button>
                        </Col>
                        <Col span="2" style="text-align: right">
                            <Icon
                                color="#fff"
                                style="background: rgb(45, 154, 244); border-radius: 50%; padding: 3px"
                                :type="showRight ? `ios-arrow-forward` : `ios-arrow-back`"
                                @click.native="clickShowRight"
                            ></Icon>
                        </Col>
                    </Row>
                    <Row v-show="openTip">
                        <Alert show-icon>
                            已选择
                            <span class="select-count">{{ selectList.length }}</span>
                            项
                            <a class="select-clear" @click="clearSelectAll">清空</a>
                        </Alert>
                    </Row>
                    <Row v-ref-height="refHeight" class="calc-px-height">

                        <div v-if="loading" class="wh-100 d-flex-around-center">
                            <Spin></Spin>
                        </div>
                        <div v-else class="wh-100">
                            <Table
                                :loading="listLoading"
                                :height="refHeight.value"
                                border
                                :columns="columns"
                                :data="data"
                                empty-text="暂无数据"
                                sortable="custom"
                                @on-sort-change="changeSort"
                                @on-selection-change="showSelect"
                                @on-row-dblclick="sjclaib"
                                ref="table"
                            >
                                <template slot-scope="{row}" slot="knqtbj">
                                    <span v-if="row.knqtbj == 0">否</span>
                                    <span v-else-if="row.knqtbj == 1">是</span>
                                    <span v-else></span>
                                </template>
                            </Table>
                            <!-- <div v-else  class="wh-100">
                                <NoData class="wh-100"></NoData>
                            </div> -->
                        </div>
                    </Row>

                    <Row type="flex" justify="end" class="page">
                        <Page
                            :current="searchForm.pageNumber"
                            :total="total"
                            :page-size="searchForm.pageSize"
                            @on-change="changePage"
                            @on-page-size-change="changePageSize"
                            :page-size-opts="[10, 20, 50, 100, 200]"
                            size="small"
                            show-total
                            show-elevator
                            show-sizer
                        ></Page>
                    </Row>
                </Card>
            </Col>
            <Col span="6" class="all-height" v-if="showRight">
                <Card class="all-height card-child-height">
                    <Row v-show="!modalVisible" @keydown.enter.native="handleSearch" style="height: 100%" >
                        <Form ref="searchForm" :model="searchForm" inline label-position="right" :label-width="180">
                            <div class="drawer-header">
                                <div style="margin-right: 16px">查询区</div>
                            </div>
                            <Row style="overflow-y: scroll; height: 75vh">
                                <Col span="24">
                                    <FormItem label="姓名" prop="name">
                                        <Input type="text" v-model="searchForm.name" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="所在院系" prop="yxmc">
                                        <Input type="text" v-model="searchForm.yxmc" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="身份证号" prop="idCard">
                                        <Input type="text" v-model="searchForm.idCard" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <!-- <Col span="24">
                                    <FormItem label="届别" prop="jb">
                                    <DatePicker v-model="searchForm.jb" type="year" format="yyyy" clearable placeholder="选择毕业年度" ></DatePicker>
                                    </FormItem>
                                </Col> -->
                                <Col span="24">
                                    <FormItem label="考生号" prop="xh">
                                        <Input type="text" v-model="searchForm.ksh" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="学号" prop="xh">
                                        <Input type="text" v-model="searchForm.xh" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="mzCode">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('mzCode')">
                                            <span>民族</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.mzCode" clearable>
                                            <Option v-for="item in mzList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="zzmmCode">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('zzmmCode')">
                                            <span>政治面貌</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.zzmmCode" clearable>
                                            <Option v-for="item in zzmmList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="xxxs">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('xxxs')">
                                            <span>学习形式</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.xxxs" clearable>
                                            <Option v-for="item in xxxsList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="zyXsz">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('zyXsz')">
                                            <span>专业</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.zyXsz" clearable>
                                            <Option v-for="(item,index) in zyList" :value="item.value" :key="index">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="专业方向" prop="zyfx">
                                        <Input type="text" v-model="searchForm.zyfx" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="pyfsCode">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('pyfsCode')">
                                            <span>培养方式</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.pyfsCode" clearable>
                                            <Option v-for="item in pyfsList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="sydCode">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('sydCode')">
                                            <span>生源所在地</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.sydCode" clearable>
                                            <Option v-for="item in areaCodeList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="cxsy">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('cxsy')">
                                            <span>城乡生源</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.cxsy" clearable>
                                            <Option v-for="item in cxsyList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem>
                                        <div class="itemLabel" slot="label" @click="clickSexCode('xz')">
                                            <span>学制</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.xz" clearable>
                                            <Option v-for="item in xzList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="毕业时间" prop="bysj">
                                        <Input type="text" v-model="searchForm.bysj" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="sfslbCode">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('sfslbCode')">
                                            <span>师范生类别</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.sfslbCode" clearable>
                                            <Option v-for="item in sfslbList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="knslbCode">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('knslbCode')">
                                            <span>困难生类别</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.knslbCode" clearable>
                                            <Option v-for="item in knslbList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="毕业状况" prop="oneType">
                                        <Input type="text" v-model="searchForm.oneType" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="毕业去向" prop="type">
                                        <Select placeholder="请选择" filterable v-model="searchForm.type" clearable>
                                            <Option v-for="item in typeList" :value="item.value" :key="item.value">
                                                <span>  {{ item.title.substring(0,20) }}</span>
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="困难群体标记" >
                                        <Select placeholder="请选择"  v-model="searchForm.knqtbj" clearable>
                                            <Option :value="0">否</Option>
                                            <Option :value="1">是</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="单位名称" prop="dwmc">
                                        <Input type="text" v-model="searchForm.dwmc" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="单位统一社会信用代码" prop="tyshxycode">
                                        <Input type="text" v-model="searchForm.tyshxycode" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="单位性质" prop="dwxz">
                                        <Input type="text" v-model="searchForm.dwxz" placeholder="请输入" clearable />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="单位行业" prop="dwhy">
                                        <Input type="text" v-model="searchForm.dwhy" placeholder="请输入" clearable/>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem prop="dwszd">
                                        <div class="itemLabel" slot="label" @click="clickSexCode('sydCode')">
                                            <span>单位所在地</span>
                                        </div>
                                        <Select placeholder="请选择" filterable v-model="searchForm.dwszd" clearable >
                                            <Option v-for="item in areaCodeList" :value="item.value" :key="item.value">
                                                {{ item.title }}
                                            </Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="工作职位类别" prop="gzzwlb">
                                        <Input type="text" v-model="searchForm.gzzwlb" placeholder="请输入" clearable  />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="单位联系人" prop="dwlxr">
                                        <Input type="text" v-model="searchForm.dwlxr" placeholder="请输入" clearable  />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="单位电话" prop="lxrdw">
                                        <Input type="text" v-model="searchForm.lxrdw" placeholder="请输入" clearable  />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="升学学校名称" prop="sxxxmc">
                                        <Input type="text" v-model="searchForm.sxxxmc" placeholder="请输入" clearable  />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="升学学校所在地" prop="sxxxszd">
                                        <Input type="text" v-model="searchForm.sxxxszd" placeholder="请输入" clearable  />
                                    </FormItem>
                                </Col>
                                <Col span="24">
                                    <FormItem label="境外学校中文名称" prop="jwxxzwmc">
                                        <Input type="text" v-model="searchForm.jwxxzwmc" placeholder="请输入" clearable  />
                                    </FormItem>
                                </Col>
                                <Col span="24">
<!--                                <FormItem label="是否确认" prop="isConfirm">-->
<!--                                    <Input type="text" v-model="searchForm.isConfirm" placeholder="请输入" clearable  />-->
<!--                                </FormItem>-->
                                    <FormItem label="是否激活" prop="isActivate">
                                        <Select placeholder="请选择" filterable v-model="searchForm.isActivate" clearable >
                                            <Option value="0">学校新增</Option>
                                            <Option value="1">学生激活</Option>
                                            <Option value="2">异动</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <span v-if="drop"></span>
                            </Row>
                            <FormItem style="position: absolute; bottom: 0" class="br box-key">
                                <Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
                                <Button @click="handleReset">重置</Button>
                                <a class="drop-down" @click="dropDown">
                                    {{ dropDownContent }}
                                    <Icon :type="dropDownIcon"></Icon>
                                </a>
                            </FormItem>
                        </Form>
                    </Row>
                    <Row class="calc-sm-height" v-show="modalVisible">
                        <div class="drawer-header">
                            <div style="margin-right: 16px">{{ modalTitle }}</div>
                        </div>
                        <Form ref="form" :model="form" :label-width="150" :rules="formValidate" label-position="left">
                            <FormItem label="户口迁转类型" prop="houseTransferTypeCode">
                                <Input v-model="form.houseTransferTypeCode" clearable />
                            </FormItem>
                            <FormItem label="户口迁转地址" prop="houseTransferAddr">
                                <Input v-model="form.houseTransferAddr" clearable />
                            </FormItem>
                            <FormItem label="户口迁转所在地" prop="houseTransferLocationCode">
                                <Input v-model="form.houseTransferLocationCode" clearable />
                            </FormItem>
                        </Form>
                        
                        <div class="br right-bottom-edit">
                            <Button type="text" @click="handleCancel">取消</Button>
                            <Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
                        </div>
                    </Row>
                </Card>
            </Col>
        </Row>

        <Modal v-model="modalExportAll" title="确认导出" :loading="loadingExport" @on-ok="exportAll">
            <p>您确认要导出全部 {{ total }} 条数据？</p>
        </Modal>
      <Modal v-model="isShow" title="同步专业分类">
        <p>同步专业分类可能需要时间较长，请耐心等待。</p>
        <div slot="footer">
          <Button type="text" @click="handelCancel">取消</Button>
          <Button type="primary" @click="syncData">同步</Button>
        </div>
      </Modal>

        <!-- 自定义导出数据 -->
        <Modal v-model="exportModalVisible" :title="exportTitle" :loading="loadingExport" @on-ok="exportCustomData">
            <Form ref="exportForm" :label-width="100">
                <FormItem label="导出文件名">
                    <Input v-model="filename" />
                </FormItem>
                <FormItem label="自定义导出列">
                    <CheckboxGroup v-model="chooseColumns">
                        <Checkbox v-for="(item, i) in exportColumns" :label="item.title" :key="i" :value="item.checked" :disabled="item.disabled"></Checkbox>
                    </CheckboxGroup>
                </FormItem>
            </Form>
        </Modal>

        <!-- 弹出框 -->
        <Modal class="cust-modal" v-model="modal" :title="modalTableTitle" @on-ok="clickTrue">
            <Row>
                <Col span="12">
                    <div class="form-item">
                        <label class="form-label">代码</label>
                        <Input v-model="searchValueKeyword" placeholder="请输入搜索的代码关键字" @on-change="handleModalTitleSearch" />
                    </div>
                </Col>
                <Col span="12">
                    <div class="form-item">
                        <label class="form-label">名称</label>
                        <Input v-model="searchTitleKeyword" placeholder="请输入搜索的名称关键字" @on-change="handleModalTitleSearch" />
                    </div>
                </Col>
            </Row>
            <div class="w-100">
                <Table class="tabbki" :columns="tableColumns" :data="dataList" :scroll="scroll" @on-row-click="handleClickRow" ref="table">

                </Table>
            </div>
            <Row type="flex" justify="end" class="page">
                <Page :current="searchModalForm.pageNumber" :total="modalTotal" :page-size="searchModalForm.pageSize" @on-change="changeModalPage" size="small" show-total show-elevator></Page>
            </Row>
        </Modal>
    </div>
</template>

<script>
import { getAllXldmzdList, getXldmzdList } from '@/api/bys/code/xldm.js';
import { archiveTransferInfoColumns, archiveTransferInfoData } from '@/views/archivesManagement/importArchiveTransferInfoTemplate';
import { getDictDataByType, getDictDataByTypeAndPage, exportAllSjhz } from '@/api/index';
import excel from '@/libs/excel';
import { exportColumn } from './exportColumn';
import { getByXlAndLevel, getByXlAndLevelPage } from '@/api/bys/code';
import Cookies from 'js-cookie';
import  NoData from '@/components/NoData.vue';

export default {
    name: 'gqArchiveTransferInfo',
    components: {
        NoData
    },
    data() {
        return {
            listLoading: false,
            lebelWidth: 140,
            loadingSync: false,
            
            // zyOptions: [], //专业选择器下拉数据
            searchModalForm: {
                // 搜索框初始化对象
                pageNumber: 1, // 当前页数
                pageSize: 10, // 页面大小
                sort: 'createTime', // 默认排序字段
                order: 'desc' // 默认排序方式
            },
            resource: '',
            isShow: false,
            modalTotal: 0,
            searchTitleKeyword: '',
            searchValueKeyword: '',
            openSearch: true, // 显示搜索
            openTip: true, // 显示提示
            loading: false, // 表单加载状态
            loading1: true, // 表单加载状态
            modalType: 0, // 添加或编辑标识
            modalVisible: false, // 添加或编辑显示
            modalTitle: '', // 添加或编辑标题
            exportModalVisible: false,
            exportTitle: '确认导出',
            filename: '数据汇总',
            loadingExport: true,
            chooseColumns: [],
            exportColumns: exportColumn,
            exportType: '',
            exportData: [],
            refHeight: {value:0},
            searchForm: {
                // 搜索框初始化对象
                gxcode: null,
                yxmc: null,
                name: '',
                idCard: '',
                jb: '',
                xh: '',
                sexCode: '',
                mzCode: '',
                zzmmCode: '',
                xlcc: '',
                xlCode: '',
                xxxs: '',
                zyCode1: '',
                zyCode: '',
                zyfx: '',
                pyfsCode: '',
                dxhwpdw: '',
                sydCode: '',
                cxsy: '',
                xz: '',
                rxsj: '',
                bysj: '',
                sfslbCode: '',
                knslbCode: '',
                szbj: '',
                birthTime: '',
                cssj: '',
                rxqdaszdw: '',
                dasfzrxx: '',
                rxqhkszdpcs: '',
                hksfzrxx: '',
                mobile: '',
                email: '',
                qq: '',
                jtdz: '',
                jtdh: '',
                jtyb: '',
                fxmc: '',
                status: '',
                houseTransferTypeCode: '',
                houseTransferAddr: '',
                houseTransferLocationCode: '',
                transferType: '',
                unitName: '',
                unitLocation: '',
                unitAddress: '',
                unitZip: '',
                unitContact: '',
                unitTel: '',
                oneType: '',
                type: '',
                knqtbj:'',
                dwmc: '',
                tyshxycode: '',
                dwxz: '',
                dwhy: '',
                dwszd: '',
                gzzwlb: '',
                dwlxr: '',
                lxrdw: '',
                dwdh: '',
                lxremail: '',
                lxrfax: '',
                dwdz: '',
                dwyb: '',
                gbjizmcl: '',
                sxxxmc: '',
                sxxxszd: '',
                jwxxzwmc: '',
                gbjistatus: '',
                isConfirm: '',
                createTime: '',
                isActivate: '',
                pageNumber: 1, // 当前页数
                pageSize: 50, // 页面大小
                sort: 'createTime', // 默认排序字段
                order: 'desc' // 默认排序方式
            },
            form: {
                // 添加或编辑表单对象初始化数据
                bysId: '',
                houseTransferTypeCode: '',
                houseTransferAddr: '',
                houseTransferLocationCode: ''
            },
            defultColumns: [
                {
                    title: '代码',
                    key: 'value',
                    sortable: false,
                    align: 'center'
                },
                {
                    title: '名称',
                    key: 'title',
                    sortable: false,
                    align: 'center'
                }
            ],
            // 表单验证规则
            formValidate: {},
            submitLoading: false, // 添加或编辑提交状态
            selectList: [], // 多选数据
            columns: [],
            columns_1: Object.freeze([
                // 表头
                // {
                //     type: 'selection',
                //     width: 60,
                //     align: 'center'
                // },
                {
                    type: 'index',
                    title: '序号',
                    width: 60,
                    align: 'center'
                },
                {
                    title: '姓名',
                    key: 'name',
                    minWidth: 100,
                    sortable: true,
                },
                {
                    title: '身份证号',
                    key: 'idCard',
                    minWidth: 180,
                    sortable: true
                },
                {
                    title: '届别',
                    key: 'jb',
                    minWidth: 80,
                    sortable: false
                },
                {
                    title: '院校名称',
                    key: 'gxmc',
                    minWidth: 180,
                    sortable: false
                },
                {
                    title: '院系名称',
                    key: 'yxmc',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '考生号',
                    key: 'ksh',
                    minWidth: 140,
                    sortable: false
                },
                {
                    title: '学号',
                    key: 'xh',
                    minWidth: 140,
                    sortable: false
                },
                {
                    title: '性别',
                    key: 'sexCode',
                    minWidth: 80,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.sexList.find(item => item.value == params.row.sexCode) ?  this.sexList.find(item => item.value == params.row.sexCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '民族',
                    key: 'mzCode',
                    minWidth: 100,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.mzList.find(item => item.value == params.row.mzCode)  ?  this.mzList.find(item => item.value == params.row.mzCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '政治面貌',
                    key: 'zzmmCode',
                    minWidth: 100,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.zzmmList.find(item => item.value == params.row.zzmmCode)  ? this.zzmmList.find(item => item.value == params.row.zzmmCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                // {
                //     title: "学历层次",
                //     key: "xlcc",
                //     minWidth: 120,
                //     sortable: false,
                //     render: (h, params) => {
                //         let dict = this.xlccList.find(item => item.value == params.row.xlcc).title
                //         return h('div', dict ? dict : '')
                //     }
                // },
                {
                    title: '学历',
                    key: 'xlCode',
                    minWidth: 100,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.xlList.find(item => item.value == params.row.xlCode)   ?  this.xlList.find(item => item.value == params.row.xlCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '学习形式',
                    key: 'xxxs',
                    minWidth: 100,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.xxxsList.find(item => item.value == params.row.xxxs) ? this.xxxsList.find(item => item.value == params.row.xxxs).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '专业',
                    key: 'zyXsz',
                    minWidth: 160,
                    sortable: false
                },
                {
                    title: '专业方向',
                    key: 'zyfx',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '培养方式',
                    key: 'pyfsCode',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.pyfsList.find(item => item.value == params.row.pyfsCode) ? this.pyfsList.find(item => item.value == params.row.pyfsCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '定向或委培单位',
                    key: 'dxhwpdw',
                    minWidth: 150,
                    sortable: false
                },
                {
                    title: '生源所在地',
                    key: 'sydCode',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.areaCodeList.find(item => item.value === params.row.sydCode);
                        return h('div', dict ? dict.title : '');
                    }
                },
                {
                    title: '城乡生源',
                    key: 'cxsy',
                    minWidth: 120,
                    sortable: false,
                    /*
                    render: (h, params) => {
                        let dict = this.cxsyList.find(item => item.value == params.row.cxsy);
                        return h('div', dict ? dict.title : '');
                    }*/
                },
                {
                    title: '学制',
                    key: 'xz',
                    minWidth: 60,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.xzList.find(item => item.value == params.row.xz) ? this.xzList.find(item => item.value == params.row.xz).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '入学时间',
                    key: 'rxsj',
                    minWidth: 80,
                    sortable: false
                },
                {
                    title: '毕业时间',
                    key: 'bysj',
                    minWidth: 80,
                    sortable: false
                },
                {
                    title: '师范生类别',
                    key: 'sfslbCode',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.sfslbList.find(item => item.value == params.row.sfslbCode) ? this.sfslbList.find(item => item.value == params.row.sfslbCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '困难生类别',
                    key: 'knslbCode',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.knslbList.find(item => item.value == params.row.knslbCode) ? this.knslbList.find(item => item.value == params.row.knslbCode).title : '';
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '所在班级',
                    key: 'szbj',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '是否52贫困县',
                    key: 'sf52pkx',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '贫困县所在省',
                    key: 'sheng',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '贫困县所在市',
                    key: 'shi',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '出生日期',
                    key: 'cssj',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '入学前档案所在单位',
                    key: 'rxqdaszdw',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '档案是否转入学校',
                    key: 'dasfzrxx',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '入学前户口所在地派出所',
                    key: 'rxqhkszdpcs',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '户口是否转入学校',
                    key: 'hksfzrxx',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '手机号码',
                    key: 'mobile',
                    minWidth: 150,
                    sortable: false
                },
                {
                    title: '电子邮箱',
                    key: 'email',
                    minWidth: 190,
                    sortable: false
                },
                {
                    title: 'QQ号码',
                    key: 'qq',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '家庭地址',
                    key: 'jtdz',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '家庭电话',
                    key: 'jtdh',
                    minWidth: 150,
                    sortable: false
                },
                {
                    title: '家庭邮编',
                    key: 'jtyb',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '分校名称',
                    key: 'fxmc',
                    minWidth: 120,
                    sortable: false
                },

                {
                    title: '户口迁转类型',
                    key: 'houseTransferTypeCode',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '户口迁转地址',
                    key: 'houseTransferAddr',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '户口迁转所在地',
                    key: 'houseTransferLocationCode',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递类型',
                    key: 'transferType',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递单位名称',
                    key: 'unitName',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递单位所在地',
                    key: 'unitLocation',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递详细地址',
                    key: 'unitAddress',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递单位邮编',
                    key: 'unitZip',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递单位联系人',
                    key: 'unitContact',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '转递单位联系电话',
                    key: 'unitTel',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '毕业状况',
                    key: 'onetype',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.oneTypeDicts.find(item => item.value == params.row.onetype) ? this.oneTypeDicts.find(item => item.value == params.row.onetype).title : '';
                        return h('div', dict ? dict : '暂未登记或上报');
                    }
                },
                {
                    title: '毕业去向',
                    key: 'type',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.typeList.find(item => item.value === params.row.type);
                        return h('div', dict ? dict.title : '');
                    }
                },
                {
                    title: '单位名称',
                    key: 'dwmc',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位统一社会信用代码',
                    key: 'tyshxycode',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位性质',
                    key: 'dwxz',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位行业',
                    key: 'dwhy',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位所在地',
                    key: 'dwszd',
                    minWidth: 120,
                    sortable: false,
                    render: (h, params) => {
                        let dict = this.areaCodeList.find(item => item.value === params.row.dwszd);
                        return h('div', dict ? dict.title : '');
                    }
                },
                {
                    title: '工作职位类别',
                    key: 'gzzwlb',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位联系人',
                    key: 'dwlxr',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '联系人电话',
                    key: 'lxrdw',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '联系人手机',
                    key: 'dwdh',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位电子邮箱',
                    key: 'lxremail',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '联系人传真',
                    key: 'lxrfax',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位地址',
                    key: 'dwdz',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '单位邮编',
                    key: 'dwyb',
                    minWidth: 120,
                    sortable: false
                },
                // {
                //     title: "证明材料(上传附件)",
                //     key: "gbjizmcl",
                //     minWidth: 120,
                //     sortable: false,
                // },
                // {
                //     title: '升学学校名称',
                //     key: 'sxxxmc',
                //     minWidth: 120,
                //     sortable: false
                // },
                // {
                //     title: '升学学校所在地',
                //     key: 'sxxxszd',
                //     minWidth: 120,
                //     sortable: false
                // },
                {
                    title: '留学国家/地区',
                    key: 'lxgjdq',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '境外学校中文名称',
                    key: 'jwxxzwmc',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '留学院校外文名称',
                    key: 'jwxxwwmc',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '留学专业中文名称',
                    key: 'lxzyzwmc',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '留学专业外文名称',
                    key: 'lxzywwmc',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '留学学历',
                    key: 'lxxl',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '困难群体标记',
                    slot: 'knqtbj',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段1',
                    key: 'kzzd1',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段2',
                    key: 'kzzd2',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段3',
                    key: 'kzzd3',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段4',
                    key: 'kzzd4',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段5',
                    key: 'kzzd5',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段6',
                    key: 'kzzd6',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段7',
                    key: 'kzzd7',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段8',
                    key: 'kzzd8',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段9',
                    key: 'kzzd9',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '扩展字段10',
                    key: 'kzzd10',
                    minWidth: 120,
                    sortable: false
                },
                {
                    title: '是否确认',
                    key: 'isConfirm',
                    minWidth: 80,
                    sortable: false,
                    render: (h, params) => {
                        return h('div', [h('div', params.row.isConfirm === 1 ? '是' : '否')]);
                    }
                },
                {
                    title: '状态',
                    key: 'isActivate',
                    align: 'center',
                    minWidth: 100,
                    render: (h, params) => {
                        if (params.row.isActivate == 0) {
                            return h('div', [
                                h('Badge', {
                                    props: {
                                        status: 'default',
                                        text: '学校新增'
                                    }
                                })
                            ]);
                        } else if (params.row.isActivate == 1) {
                            return h('div', [
                                h('Badge', {
                                    props: {
                                        status: 'success',
                                        text: '学生激活'
                                    }
                                })
                            ]);
                        } else {
                            return h('div', [
                                h('Badge', {
                                    props: {
                                        status: 'error',
                                        text: '异常'
                                    }
                                })
                            ]);
                        }
                    }
                },
                {
                    title: '账号状态',
                    key: 'status',
                    align: 'center',
                    minWidth: 100,
                    render: (h, params) => {
                        if (params.row.status == 0) {
                            return h('div', [
                                h('Badge', {
                                    props: {
                                        status: 'success',
                                        text: '启用'
                                    }
                                })
                            ]);
                        } else if (params.row.status == -1) {
                            return h('div', [
                                h('Badge', {
                                    props: {
                                        status: 'error',
                                        text: '禁用'
                                    }
                                })
                            ]);
                        }
                    },
                    filters: [
                        {
                            label: '启用',
                            value: 0
                        },
                        {
                            label: '禁用',
                            value: -1
                        }
                    ],
                    filterMultiple: false,
                    filterRemote: e => {
                        let v = '';
                        if (e.length > 0) {
                            v = e[0];
                        }
                        this.searchForm.status = v;
                        this.searchForm.pageNumber = 1;
                        this.getDataList();
                    }
                },
                {
                    title: '创建时间',
                    key: 'createTime',
                    sortable: true,
                    sortType: 'desc',
                    minWidth: 180
                }
            ]),
            data: [], // 表单数据
            total: 0, // 表单数据总数
            importModalVisible: false,
            importTableData: [],
            importColumns: [],
            uploadfile: {
                name: ''
            },
            zyColumns: [
                {
                    title: '学历分类',
                    key: 'xlflz',
                    sortable: false,
                    align: 'center',
                    render: (h, params) => {
                        let dict = this.xlccList.find(item => item.value == params.row.xllxz).title;
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '专业',
                    key: 'title',
                    sortable: false,
                    align: 'center'
                }
            ],
            reading: false,
            importLoading: false,
            height: 510,
            tempColumns: archiveTransferInfoColumns,
            tempData: archiveTransferInfoData,
            showRight: true,
            editTitle: '',
            formTree: {
                id: ''
            },
            searchKey: '',
            expandLevel: 1,
            oneTypeDicts: [],
            dataEdit: [],
            dataTree: [],
            strict: true,
            sexList: [],
            mzList: [],
            zzmmList: [],
            xlccList: [],
            xlList: [],
            xxxsList: [],
            pyfsList: [],
            xzList: [],
            typeList: [],
            sfslbList: [],
            knslbList: [],
            cxsyList: [],
            sexCodes: [],
            zyCodeList: [],
            zyList: [],
            areaCodeList: [],
            modal: false,
            dataList: [],
            scroll: {
                y: '200px' // 表头固定的高度
            },
            modalTableTitle: '',
            tableColumns: [
                {
                    title: '',
                    key: 'value',
                    sortable: false,
                    minWidth: 150,
                    align: 'center'
                },
                {
                    title: '名称',
                    key: 'title',
                    sortable: false,
                    minWidth: 150,
                    align: 'center'
                }
            ],
            modalDict: '',
            showCode: '', //双击行传递的值
            rowList: null,
            xlflColumns: [
                {
                    title: '学历分类',
                    key: 'xlflz',
                    sortable: false,
                    align: 'center',
                    render: (h, params) => {
                        console.log(this.xlccDicts, 'this.xlccDicts');
                        let dict = this.xlccList.find(item => item.value == params.row.xllxz).title;
                        return h('div', dict ? dict : '');
                    }
                },
                {
                    title: '代码',
                    key: 'value',
                    sortable: false,
                    align: 'center'
                },
                {
                    title: '名称',
                    key: 'title',
                    sortable: false,
                    align: 'center'
                }
            ]
        };
    },
    methods: {
        // // 专业 异步加载数据
        // loadData(zyVisible) {
        //     if (zyVisible) {
        //         // 模拟异步加载数据
        //         setTimeout(() => {
        //             getByXlAndLevel({ gradLevelDict: this.searchForm.xlcc, level: '2' }).then(res => {
        //                 if (res.success) {
        //                     this.zyOptions = res.result.map(e => {
        //                         return {
        //                             xllxz: e.gradLevelDict,
        //                             value: e.profCode + e.title,
        //                             title: e.profCode + e.title,
        //                             zy: e.title,
        //                             zyCode: e.profCode
        //                         };
        //                     });
        //                 }
        //             });
        //         }, 500);
        //     }
        // },
        showWindows() {
          this.isShow = true;
        },
        syncData() {
              this.getRequest('/bysPersonInfo/syncZyData').then(res => {
                if (res.success) {
                  this.$message.success("同步成功");
                } else {
                  this.$message.error("同步失败");
                }
              })
              this.isShow = false;
        },
        handelCancel() {
           this.isShow = false;
        },
        handleModalTitleSearch() {
            this.handleWatchModalDictData(this.currentModalSearch);
        },
        changeModalPage(v) {
            this.searchModalForm.pageNumber = v;
            this.handleWatchModalDictData(this.currentModalSearch);
        },
        tableheig() {
            // var bbb = document.getElementsByClassName('calc-px-height')[0].scrollHeight;
            // var aaa = document.getElementsByClassName('calc-px-height')[0].children[0].children[0].children[1];
            // var ccc = document.getElementsByClassName('calc-px-height')[0].children[0].children[0].children[0].scrollHeight;
            // var ddd = bbb - ccc;
            // console.log(bbb, '00000000000000');
            // aaa.style.height = `${ddd - 4}px`;
        },
        init() {
            this.getDictDataByType();
            this.getDataList();
            this.getAllList();
            // 初始化导出列数据
            let array = [];
            this.exportColumns.forEach(e => {
                // 指定列限制权限
                // if (
                //     !this.getStore("roles").includes("ROLE_ADMIN") &&
                //     e.key == "mobile"
                // ) {
                //   e.title = "[无权导出] " + e.title;
                //   e.disabled = true;
                // } else {
                //   e.disabled = false;
                // }
                array.push(e.title);
            });
            this.chooseColumns = array;
        },
        //代码按钮
        clickSexCode(e) {
            this.showCode = e;
            this.modal = true;
            this.searchTitleKeyword = '';
            this.searchValueKeyword = '';
            this.searchModalForm.pageNumber = 1;
            this.searchModalForm.pageSize = 50;
            this.currentModalSearch = e;
            this.showDict(e);
        },
        showDict(e) {
            this.tableColumns = this.defultColumns;
            if (e == 'sexCode') {
                this.modalTableTitle = '性别';
                this.modalDict = 'sex';
                // this.huqushuju(this.modalDict)
            } else if (e == 'mzCode') {
                this.modalTableTitle = '民族';
                this.modalDict = 'ethnic';
                // this.huqushuju(this.modalDict)
            } else if (e == 'zzmmCode') {
                this.modalTableTitle = '政治面貌';
                this.modalDict = 'political';
                // this.huqushuju(this.modalDict)
            } else if (e == 'xlCode') {
                this.modalTableTitle = '学历';
                this.modalDict = 'degree';
                this.tableColumns = this.xlflColumns;
                // this.huqushuju(this.modalDict)
            } else if (e == 'zyXsz') {
                this.modalTableTitle = '专业';
                this.modalDict = 'zyXsz';
                this.tableColumns = this.zyColumns;
            } else if (e == 'xxxs') {
                this.modalTableTitle = '学习形式';
                this.modalDict = 'learning-forms';
                // this.huqushuju(this.modalDict)
            } else if (e === 'pyfsCode') {
                this.modalTableTitle = '培养方式';
                this.modalDict = 'training-methods';
                // this.huqushuju(this.modalDict)
            } else if (e == 'xz') {
                this.modalTableTitle = '学制';
                this.modalDict = 'educational-system';
                // this.huqushuju(this.modalDict)
            } else if (e == 'sfslbCode') {
                this.modalTableTitle = '师范生类别';
                this.modalDict = 'sfs_type';
                // this.huqushuju(this.modalDict)
            } else if (e == 'knslbCode') {
                this.modalTableTitle = '困难生类别';
                this.modalDict = 'difficult-student-category';
                // this.huqushuju(this.modalDict)
            } else if (e == 'sydCode') {
                this.modalTableTitle = '生源所在地';
                this.modalDict = 'syd_code';
                this.dataList = this.areaCodeList;
            } else if (e == 'dwszd') {
                this.modalTableTitle = '单位所在地';
                this.modalDict = 'dwszd';
                this.dataList = this.areaCodeList;
            } else if (e == 'cxsy') {
                this.modalTableTitle = '城乡生源';
                this.modalDict = 'cxsy';
                this.dataList = this.cxsyList;
            } else if (e == 'type') {
                this.modalTableTitle = '毕业去向';
                this.modalDict = 'type';
                this.dataList = this.typeList;
            }
            this.handleWatchModalDictData(this.currentModalSearch);
        },
        getZydm() {
            getByXlAndLevel({ gradLevelDict: this.searchForm.xlcc, level: '2' }).then(res => {
                if (res.success) {
                    this.dataList = res.result.map(e => {
                        return {
                            xllxz: e.gradLevelDict,
                            value: e.profCode + e.title,
                            title: e.profCode + e.title,
                            zy: e.title,
                            zyCode: e.profCode
                        };
                    });
                }
            });
        },
        huqushuju(v) {
            if (v === 'degree') {
                getAllXldmzdList().then(res => {
                    if (res.success) {
                        this.dataList = res.result.map(el => {
                            return {
                                value: el.xldm,
                                title: el.xl,
                                xllxz: el.xllxz
                            };
                        });
                    }
                });
            } else {
                getDictDataByType(v).then(res => {
                    if (res.success) {
                        console.log(res, '数据');
                        this.dataList = res.result;
                    }
                });
            }
        },
        // 单击弹出框表格
        handleClickRow(row) {
            this.rowList = row;
            console.log(row);
            this.clickTrue();
        },
        //弹框按钮
        clickTrue() {
            this.modal = false;
            console.log(this.showCode);
            this.searchForm[this.showCode] = this.rowList.value;
        },

        getDictDataByType() {
            getByXlAndLevel({ gradLevelDict: this.searchForm.xlcc, level: '2' }).then(res => {
                if (res.success) {
                    this.zyList = res.result.map(e => {
                        return {
                            xllxz: e.gradLevelDict,
                            value: e.profCode + e.title,
                            title: e.profCode + e.title,
                            zy: e.title,
                            zyCode: e.profCode
                        };
                    });
                }
            });
            //就业状况
            getDictDataByType('qx').then(res => {
                if (res.success) {
                    this.oneTypeDicts = res.result;
                    console.log(this.oneTypeDicts, '毕业状况');
                }
            });
            // 去向代码
            this.postRequest('/gqQxCode/getAll').then(res => {
                if (res.success) {
                    this.typeList = res.result.map(e => {
                        return { value: e.profCode + '', title: e.title };
                    });
                    console.log(this.typeList, '去向列表书库');
                }
            });
            // 生源所在地
            this.postRequest('/areaCode/getAll').then(res => {
              console.log(res.result,"ss");
                if (res.success) {
                    this.areaCodeList = res.result.map(e => {
                        return { value: e.code, title: e.displayName };
                    });
                }
            });
            //性别
            getDictDataByType('sex').then(res => {
                if (res.success) {
                    this.sexList = res.result;
                }
            });
            //   民族
            getDictDataByType('ethnic').then(res => {
                if (res.success) {
                    this.mzList = res.result;
                }
            });
            //   政治面貌
            getDictDataByType('political').then(res => {
                if (res.success) {
                    this.zzmmList = res.result;
                }
            });
            //   学历层次
            getDictDataByType('eduLevelType').then(res => {
                if (res.success) {
                    this.xlccList = res.result;
                    this.zyCodeList = res.result.map(item => ({
                        ...item,
                        label: item.title,
                        loading: false,
                        children: []
                    }));
                }
            });
            //   学历
            getDictDataByType('degree').then(res => {
                if (res.success) {
                    this.xlList = res.result;
                }
            });
            //城乡生源
            getDictDataByType('cxsy').then(res => {
                if (res.success) {
                    this.cxsyList = res.result;
                }
            });
            //   学习形式
            getDictDataByType('learning-forms').then(res => {
                if (res.success) {
                    this.xxxsList = res.result;
                }
            });
            //培养方式 training-methods
            getDictDataByType('training-methods').then(res => {
                if (res.success) {
                    this.pyfsList = res.result;
                }
            });
            //   educational-system 学制
            getDictDataByType('educational-system').then(res => {
                if (res.success) {
                    this.xzList = res.result;
                }
            });
            //   educational-system 师范生类别
            getDictDataByType('sfs_type').then(res => {
                if (res.success) {
                    this.sfslbList = res.result;
                }
            });
            //   困难生类别代码
            getDictDataByType('difficult-student-category').then(res => {
                if (res.success) {
                    this.knslbList = res.result;
                }
            });
        },
        zyLoadData(item, callback) {
            // item.loading = true;
            getByXlAndLevel({ gradLevelDict: item.value, level: '2' }).then(res => {
                item.children = res.result.map(item => ({ ...item, label: item.title, value: item.profCode }));
                item.loading = false;
                callback();
            });
        },
        zyFormat(labels, selectedData) {
            const index = labels.length - 1;
            const data = selectedData[index] || false;
            this.searchForm.xlcc = data.gradLevelDict;
            this.searchForm.zyCode = data.value;
            return labels;
        },
        cancelEdit() {
            // this.loading = true;
            this.searchForm.gxcode = null;
            this.searchForm.yxmc = null;
            this.postRequest('/bysPersonInfo/queryPageForStudentAllInfo', this.searchForm).then(res => {
                this.loading = false;
                if (res.success) {
                    let value = res.result;
                    this.data = [];
                    value.records.forEach(el => {
                        if (el.zyCode) {
                            el.zy == null ? el.zyXsz = el.zyCode : el.zyXsz = el.zyCode + el.zy
                        }
                        console.log(el, 'el.zyXsz');
                        this.data.push(el);
                    });
                    this.total = value.total;
                    this.tableheig();
                }
            });
            let data = this.$refs.tree.getSelectedNodes()[0];
            if (data) {
                data.selected = false;
            }
            // this.$refs.form.resetFields();
            this.formTree.id = '';
            this.editTitle = '';
            this.getAllList();
        },
        changeSelect(v) {
            this.selectList = v;
        },
        search() {
            this.loading1 = true;
            this.postRequest('/bysPersonInfo/getSchoolCollegeTree', { name: this.searchKey }).then(res => {
                if (res.success) {
                    this.loading1 = false;
                    let treeValue = res.result.map(item => {
                        if(item.title){
                          return {
                            title: item.title,
                            schoolCode: item.schoolCode,
                            expand: false,
                            level: 0,
                            total: item.total,
                            children: item.children?.map(item_ => {
                              return {
                                title: item_.college,
                                level: 1,
                                schoolName: item_.schoolName,
                                schoolCode: item_.schoolCode,
                                total: item_.total
                              }
                            })
                          };
                        }
                    });
                    this.dataTree = treeValue;
                }
            });
        },
        //获取树状结构数据
        getAllList() {
            this.loading1 = true;
            this.postRequest('/bysPersonInfo/getSchoolCollegeTree',{ gxmc: null }).then(res => {
                if (res.success) {
                    this.loading1 = false;
                    let treeValue = res.result.map(item => {
                        return {
                            title: item.title,
                            schoolCode: item.schoolCode,
                            expand: false,
                            level: 0,
                            total: item.total,
                            children: item.children?.map(item_ => {
                                return {
                                    title: item_.college,
                                    level: 1,
                                    schoolName: item_.schoolName,
                                    schoolCode: item_.schoolCode,
                                    total: item_.total
                                }
                            })
                        };
                    });
                    this.dataTree = treeValue;
                }
            });
        },
        renderContent(h, { root, node, data }) {
            let icon = '';
            if (data.level == 0) {
                icon = 'ios-navigate';
            } else if (data.level == 1) {
                icon = 'md-list-box';
            } else if (data.level == 2) {
                icon = 'md-list';
            } else if (data.level == 3) {
                icon = 'md-radio-button-on';
            } else {
                icon = 'md-radio-button-off';
            }
            return h('span', [
                h('span', [
                    h('Icon', {
                        props: {
                            type: icon,
                            size: '16'
                        },
                        style: {
                            'margin-right': '8px',
                            'margin-bottom': '3px'
                        }
                    }),
                    h('span', data.title)
                ])
            ]);
        },
        selectTree(v) {
            console.log(v, '点击左侧选项');
          this.searchForm={
            // 搜索框初始化对象
              gxcode: null,
                name: '',
                idCard: '',
                jb: '',
                xh: '',
                sexCode: '',
                mzCode: '',
                zzmmCode: '',
                xlcc: '',
                xlCode: '',
                xxxs: '',
                zyCode1: '',
                zyCode: '',
                zyfx: '',
                pyfsCode: '',
                dxhwpdw: '',
                sydCode: '',
                cxsy: '',
                xz: '',
                rxsj: '',
                bysj: '',
                sfslbCode: '',
                knslbCode: '',
                szbj: '',
                birthTime: '',
                cssj: '',
                rxqdaszdw: '',
                dasfzrxx: '',
                rxqhkszdpcs: '',
                hksfzrxx: '',
                mobile: '',
                email: '',
                qq: '',
                jtdz: '',
                jtdh: '',
                jtyb: '',
                fxmc: '',
                status: '',
                houseTransferTypeCode: '',
                houseTransferAddr: '',
                houseTransferLocationCode: '',
                transferType: '',
                unitName: '',
                unitLocation: '',
                unitAddress: '',
                unitZip: '',
                unitContact: '',
                unitTel: '',
                oneType: '',
                type: '',
                knqtbj:'',
                dwmc: '',
                tyshxycode: '',
                dwxz: '',
                dwhy: '',
                dwszd: '',
                gzzwlb: '',
                dwlxr: '',
                lxrdw: '',
                dwdh: '',
                lxremail: '',
                lxrfax: '',
                dwdz: '',
                dwyb: '',
                gbjizmcl: '',
                sxxxmc: '',
                sxxxszd: '',
                jwxxzwmc: '',
                gbjistatus: '',
                isConfirm: '',
                createTime: '',
                isActivate: '',
                pageNumber: 1, // 当前页数
                pageSize: 50, // 页面大小
                sort: 'createTime', // 默认排序字段
                order: 'desc' // 默认排序方式
            }
            let data = v[0];
            let schoolName;
            let schoolCode;
            let collegeName;
            if (data.level === 0) {
                // 当前是学校
                schoolName = data.title;
                schoolCode = data.schoolCode;
            } else if (data.level === 1) {
                // 当前是学院
                let index = data.title.indexOf('(');
                console.log(data.title.substring(0,index),'截取');
                collegeName = data.title.substring(0,index);
                schoolCode = data.schoolCode;
                schoolName = data.schoolName;
            }
            this.searchForm.gxcode = schoolCode;
            this.searchForm.yxmc = collegeName;
            this.editTitle = schoolName;
            // this.loading = true;
            this.listLoading = true
            this.postRequest('/bysPersonInfo/queryPageForStudentAllInfo', this.searchForm).then(res => {
                this.loading = false;
                this.listLoading = false
                if (res.success) {
                    let value = res.result;
                    this.data = [];
                    value.records.forEach(el => {
                        if (el.zyCode) {
                            el.zyXsz = el.zyCode + el.zy;
                        } else {
                            el.zyXsz = '';
                        }
                        console.log(el, 'el.zyXsz');
                        this.data.push(el);
                    });
                    this.total = value.total;
                    this.tableheig();
                }
            });
        },

        // 显示隐藏右侧区域
        clickShowRight() {
            this.showRight = !this.showRight;
        },
        changePage(v) {
            this.searchForm.pageNumber = v;
            this.getDataList();
            this.clearSelectAll();
        },
        changePageSize(v) {
            this.searchForm.pageSize = v;
            this.getDataList();
        },
        selectDateRange(v) {
            if (v) {
                this.searchForm.startDate = v[0];
                this.searchForm.endDate = v[1];
            }
        },
        getDataList() {
            // this.loading = true;
            this.listLoading = true
            // 带多条件搜索参数获取表单数据 请自行修改接口
            this.postRequest('/bysPersonInfo/queryPageForStudentAllInfo', this.searchForm).then(res => {
                if (res.success) {
                    let value = res.result;
                    this.data = [];
                    value.records.forEach(el => {
                        if (el.zyCode) {
                            el.zy == null ? el.zyXsz = el.zyCode : el.zyXsz = el.zyCode + el.zy
                        }
                        this.data.push(el);
                    });
                    this.total = value.total;
                    this.tableheig();
                    this.loading = false;
                } else {
                    this.loading = false;
                }
                this.listLoading = false
            });
            this.total = this.data.length;
            // this.loading = false;
        },
        handleSearch() {
            if (this.searchForm.jb !== '') this.searchForm.jb = new Date(this.searchForm.jb).getFullYear();
            this.searchForm.pageNumber = 1;
            this.searchForm.pageSize = 50;
            this.getDataList();
        },
        handleReset() {
            this.searchForm = {}
            this.searchForm.jb = ''
            this.searchForm.sort = 'createTime';
            this.searchForm.order = 'desc';
            this.$refs.searchForm.resetFields();
            this.searchForm.pageNumber = 1;
            this.searchForm.pageSize = 50;
            this.selectDate = null;
            this.searchForm.startDate = '';
            this.searchForm.endDate = '';
            this.selectCat = [];
            this.searchForm.categoryId = '';
            this.searchForm.zyCode1 = '';
            // 重新加载数据
            this.getDataList();
        },
        changeSort(e) {
            this.searchForm.sort = e.key;
            this.searchForm.order = e.order;
            if (e.order == 'normal') {
                this.searchForm.order = '';
            }
            this.getDataList();
        },
        handleDropdown(name) {
            if (name == 'refresh') {
                this.getDataList();
            } else if (name == 'exportData') {
                if (this.selectList.length <= 0) {
                    this.$Message.warning('您还未选择要导出的数据');
                    return;
                }
                this.$Modal.confirm({
                    title: '确认导出',
                    content: '您确认要导出所选 ' + this.selectList.length + ' 条数据?',
                    onOk: () => {
                        this.$refs.exportTable.exportCsv({
                            filename: '导出数据'
                        });
                    }
                });
            } else if (name == 'exportAll') {
                this.modalExportAll = true;
            }
        },
        exportAll() {
            this.modalExportAll = false;
            this.$refs.exportTable.exportCsv({
                filename: '用户全部数据'
            });
        },
        handleCancel() {
            this.modalVisible = false;
        },
        handleSubmit() {
            this.$refs.form.validate(valid => {
                if (valid) {
                    this.submitLoading = true;
                    if (this.modalType === 0) {
                        // 添加 避免编辑后传入id等数据 记得删除
                        delete this.form.id;
                        this.postRequest('/accountTransferInfo/insertOrUpdate', this.form).then(res => {
                            this.submitLoading = false;
                            if (res.success) {
                                this.$Message.success('操作成功');
                                this.getDataList();
                                this.modalVisible = false;
                            }
                        });
                    } else {
                        // 编辑
                        this.postRequest('/accountTransferInfo/insertOrUpdate', this.form).then(res => {
                            this.submitLoading = false;
                            if (res.success) {
                                this.$Message.success('操作成功');
                                this.getDataList();
                                this.modalVisible = false;
                            }
                        });

                    }
                }
            });
        },
        handleUpload(v) {
            this.form.avatar = v;
        },
        add() {
            this.modalType = 0;
            this.modalTitle = '添加';
            this.$refs.form.resetFields();
            this.modalVisible = true;
        },
        edit(v) {
            this.modalType = 1;
            this.modalTitle = '编辑';
            this.$refs.form.resetFields();
            // 转换null为""
            for (let attr in v) {
                if (v[attr] == null) {
                    v[attr] = '';
                }
            }
            let str = JSON.stringify(v);
            let data = JSON.parse(str);
            this.form = data;
            this.modalVisible = true;
        },
        enable(v) {
            this.$Modal.confirm({
                title: '确认启用',
                // 记得确认修改此处
                content: '您确认要启用 ' + v.name + ' ?',
                loading: true,
                onOk: () => {

                    this.$Message.success('操作成功');
                    this.$Modal.remove();
                    this.getDataList();
                }
            });
        },
        disable(v) {
            this.$Modal.confirm({
                title: '确认禁用',
                // 记得确认修改此处
                content: '您确认要禁用 ' + v.name + ' ?',
                loading: true,
                onOk: () => {
                    this.$Message.success('操作成功');
                    this.$Modal.remove();
                    this.getDataList();
                }
            });
        },
        remove(v) {
            let param = {
                ids: v.id
            };
            this.$Modal.confirm({
                title: '确认删除',
                // 记得确认修改此处
                content: '您确认要删除该条数据?',
                loading: true,
                onOk: () => {
                    // 删除
                    this.postRequest('/accountTransferInfo/delByIds', param).then(res => {
                        this.$Modal.remove();
                        if (res.success) {
                            this.$Message.success('操作成功');
                            this.clearSelectAll();
                            this.getDataList();
                        }
                    });
                }
            });
        },
        dropDown() {
            if (this.drop) {
                this.dropDownContent = '展开';
                this.dropDownIcon = 'ios-arrow-down';
            } else {
                this.dropDownContent = '收起';
                this.dropDownIcon = 'ios-arrow-up';
            }
            this.drop = !this.drop;
        },
        sjclaib(v) {
            this.$refs.searchForm.resetFields();
            // 转换null为""
            for (let attr in v) {
                if (v[attr] === null) {
                    v[attr] = '';
                }
            }
            let str = JSON.stringify(v);
            let data = JSON.parse(str);
            this.searchForm = data;
        },
        showSelect(e) {
            this.exportData = e;
            this.selectList = e;
        },
        clearSelectAll() {
            this.$refs.table.selectAll(false);
        },
        delAll() {
            if (this.selectList.length <= 0) {
                this.$Message.warning('您还未选择要删除的数据');
                return;
            }
            this.$Modal.confirm({
                title: '确认删除',
                content: '您确认要删除所选的 ' + this.selectList.length + ' 条数据?',
                loading: true,
                onOk: () => {
                    let ids = '';
                    this.selectList.forEach(function (e) {
                        ids += e.id + ',';
                    });
                    ids = ids.substring(0, ids.length - 1);
                    // 批量删除
                    this.postRequest('/accountTransferInfo/delByIds/', { ids: ids }).then(res => {
                        this.$Modal.remove();
                        if (res.success) {
                            this.$Message.success('操作成功');
                            this.clearSelectAll();
                            this.getDataList();
                        }
                    });
                }
            });
        },
        //导出所选数据
        dropExportData() {
            if (this.selectList.length <= 0) {
                this.$Message.warning('您还未选择要导出的数据');
                return;
            }
            this.exportType = 'part';
            this.exportModalVisible = true;
            this.exportTitle = '确认导出 ' + this.selectList.length + ' 条数据';
            // "确认导出 " + this.selectList.length + " 条数据(付费)";
        },
        //导出全部数据
        dropExportAll() {
            this.importing1 = true;
            exportAllSjhz().then(res => {
                this.importing1 = false;
                // type的格式可以可以设置，可以把appcation/json设置进去，然后设置导出的类型
                console.log(res)
                const blob = new Blob([res], { type: 'charset=utf-8' });

                let url = window.URL.createObjectURL(blob);

                const link = document.createElement('a');
                link.style.display = 'none';
                link.href = url;
                link.setAttribute('download', '数据汇总.xlsx');
                document.body.appendChild(link);
                link.click();
                document.body.removeChild(link); // 删除节点
                window.URL.revokeObjectURL(url); //释放该 url
            });
        },
        exportCustomData() {
            if (this.filename === '') {
                this.filename = '数据汇总';
            }
            // 判断勾选导出列
            let array = [];
            this.exportColumns.forEach(e => {
                this.chooseColumns.forEach(c => {
                    if (e.title == c && !e.disabled) {
                        array.push(e);
                    }
                });
            });
            this.exportColumns = array;
            this.exportModalVisible = false;
            let title = [];
            let key = [];
            this.exportColumns.forEach(e => {
                title.push(e.title);
                key.push(e.key);
            });
            const params = {
                title: title,
                key: key,
                data: this.exportData,
                autoWidth: true,
                filename: this.filename
            };
            excel.export_array_to_excel(params);
        },
        handleWatchModalDictData(e) {
            this.dataList = [];
            if (e == 'sexCode') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'sex',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'mzCode') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'ethnic',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'zzmmCode') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'political',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'xlCode') {
                getXldmzdList({
                    ...this.searchForm,
                    xldm: this.searchValueKeyword,
                    xl: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.records.map(el => {
                            return {
                                value: el.xldm,
                                title: el.xl,
                                xllxz: el.xllxz
                            };
                        });
                        this.modalTotal = res.result.total;
                    }
                });
            } else if (e == 'zyXsz') {
                getByXlAndLevelPage({
                    ...this.searchForm,
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.records.map(el => {
                            return {
                                xllxz: el.gradLevelDict,
                                value: el.profCode + el.title,
                                title: el.profCode + el.title,
                                zy: el.title,
                                zyCode: el.profCode
                            };
                        });
                        this.modalTotal = res.result.total;
                    }
                });
            } else if (e == 'xxxs') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'learning-forms',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'pyfsCode') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'training-methods',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'xz') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'educational-system',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'sfslbCode') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'sfs_type',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'knslbCode') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'difficult-student-category',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'sydCode') {
                this.postRequest('/areaCode/getByPage', {
                    ...this.searchForm,
                    code: this.searchValueKeyword,
                    displayName: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.records.map(e => {
                            return { value: e.code, title: e.displayName };
                        });
                        this.modalTotal = res.result.total;
                    }
                });
            } else if (e == 'cxsy') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'cxsy',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            } else if (e == 'type') {
                getDictDataByTypeAndPage({
                    ...this.searchForm,
                    type: 'bys-destination',
                    value: this.searchValueKeyword,
                    title: this.searchTitleKeyword
                }).then(res => {
                    if (res.success) {
                        this.dataList = res.result.content;
                        this.modalTotal = res.result.totalElements;
                    }
                });
            }
        },
        onRestWindow() {
            this.columns = this.restTableCellWidth(this.columns_1)
            this.labelWidth = this.searchLabelWidth(140)
        }
    },
    watch: {
        modalDict(val) {
            return this.handleWatchModalDictData(this.currentModalSearch);
        }
    },
    mounted() {
        this.onRestWindow()
        window.addEventListener('resize',this.onRestWindow)
        let resource = JSON.parse(Cookies.get('userInfo')).resource;
        this.resource = resource
        this.init();

    },
    beforeDestroy() {
        window.removeEventListener('resize',this.onRestWindow)
    }
};
</script>
<style lang="less" scoped>
.form-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    margin-right: 15px;
}

.form-label {
    margin-right: 10px;
    width: 40px;
}

/deep/ .ivu-tree-title {
    width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    margin-right: 15px;
}

.form-label {
    margin-right: 10px;
    width: 40px;
}

.page {
    margin-top: 20px;
}

.tabbki {
/deep/ .ivu-table {
        .ivu-table-body {
            height: 450px !important;
            overflow-y: scroll;
        }
    }
}

/deep/ .ivu-table {
    .ivu-table-body {
        // height: 90.7% !important;
    }
}

/deep/ .ivu-tree-arrow i {
    position: absolute;
    right: 0;
    margin-top: -12px;
}

.itemLabel {
    span {
        color: rgb(55, 140, 254) !important;
        cursor: pointer;
    }
}
.search-item {
    width: 190px ;
}

/deep/ .ivu-icon {
    font-size: 16px !important;
}

.cust-modal {
    /deep/.ivu-modal {
         width: 30% !important;
     }
 }


 @media (max-width: 1920px) {

    /deep/ .ivu-table-body {
        height: 91% !important;
    }
}
// 重构样式
/deep/ .ivu-form-item-label{
    display: flex;
    justify-content: right;
    width: 190px !important;
}
/deep/ .ivu-form-item {
    width: 100%;
    margin-bottom: 0.1rem;
    margin-right: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/deep/ .ivu-form-item-content {
    width: 100% !important;
    margin-left: 0 ! important;
}
/deep/ .ivu-select {
    width: 100% !important;
}
/deep/ .ivu-date-picker {
    width: 100% !important;
}
/deep/ .br {
    // margin-top: 15px;
    .ivu-form-item-content {
        display: flex;
    }
}
.box-key {
    /deep/ .ivu-form-item-content {
        margin-left: 120px !important;
    }
    bottom: 3px !important;
}
</style>